﻿using Lesson13_异步_服务端;
using System.Net.Sockets;

namespace Program
{
    class Program
    {
        static void Main(string[] args)
        {
            ServerSocket serverSocket = new ServerSocket();
            serverSocket.Start("127.0.0.1", 8080, 1000);

            while (true)
            {
                string input = Console.ReadLine();
                if (input.Substring(0, 2) == "B:")
                {
                    if (input.Length < 3)
                        return;
                    string msg = input.Substring(2);
                    serverSocket.Broadcast(msg);
                }
            }
        }
    }
}